package il.ac.tau.cg.ex5;

import il.ac.tau.cg.ex5.engine.Engine;
import il.ac.tau.cg.ex5.obj.ObjEntity;
import il.ac.tau.cg.ex5.obj.parser.ObjParser;

import java.io.File;
import java.io.IOException;

public class Main
{
	public static void main(String[] args)
	{
		if (args.length != 1)
		{
			System.err.println("Please provide an OBJ file name as a command line argument.");
			return;
		}
		
		File objFile = new File(args[0]);
		ObjEntity objEntity = null;
		
		try
		{
			objEntity = new ObjParser().parse(objFile);
		}
		catch (IOException e)
		{
			System.err.println("Unable to parse OBJ file.");
			return;
		}
		
		new Engine(objEntity).start();
	}
}
